package com.zh.sharding.sale.support;

import com.zh.sharding.sale.entity.OperateLogRecord;
import com.zh.sharding.sale.repository.OperationDao;
import org.springframework.stereotype.Component;

/**
 * @author zhou
 * @date 2023/8/23
 */
@Component
public class OperationHelper {
    private static OperationDao operationDao;

    public OperationHelper(OperationDao operationDao) {
        OperationHelper.operationDao = operationDao;
    }

    public static void log(String content) {
        operationDao.insert(new OperateLogRecord(content));
    }

    public static void testLog(OperateLogRecord logRecord) {
        operationDao.insert(logRecord);
    }
}
